﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="H2.NET.Web.Management.Account.Edit" %>

<script type="text/javascript">
    $(document).ready(function () {

        $("#roles").select2({
            placeholder: "点击这里选择一个角色..."
        });

    });
    function change() {
        $.ajax({
            url: "/Page/User/Create.aspx?action=change&depart=" + escape(document.getElementById("ddl_Depart").value),

            type: "POST",
            data: { name: "keyun" },
            dataType: "html",
            success: function (result) {
                $("#ddl_GW", $.pdialog.getCurrent()).html("");
                $("#ddl_GW", $.pdialog.getCurrent()).append(result);

            }
        });
    }
</script>
<div class="page">
    <div class="pageContent">
        <form method="post" action="<%=H2.NET.Common.AksRequest.GetVirtualUrl()%>?action=save" class="pageForm required-validate"
        onsubmit="return validateCallback(this, dialogAjaxDone);">
        <div class="pageFormContent" layouth="49">
            <input type="hidden" name="Id" value="<%= account.Id %>" />
            <input type="hidden" name="LastLoginTime" value="<%= account.LastLoginTime.Year < 2000 ? DateTime.Now :account.LastLoginTime %>" />
            <input type="hidden" name="LastLoginIp" value="<%= account.LastLoginIp %>" />
            <input type="hidden" name="OldUsername" value="<%= account.Username %>" />
            <table class="formTable">
                <tr>
                    <th>
                        <label>
                            用户名：</label>
                    </th>
                    <td>
                        <input name="Username" id="Username" class="required" type="text" size="30" readonly="readonly" value="<%=account.Username%>" />
                    </td>
                </tr>
                <tr style="display:none;">
                    <th><label>状态：</label></th>
                    <td>
                        <lable><input type="radio" name="Status" value="true" <%= account.Status == true ? "checked" : "" %> />启用</lable>
                        <lable><input type="radio" name="Status" value="false" <%= account.Status == false ? "checked" : "" %> />不启用</lable>
                    </td>
                </tr>
                <tr>
                    <th><lable>角色配置：</lable></th>
                    <td>
                        <select multiple style="width: 100%;" name="roles" id="roles">
                            <asp:literal runat="server" ID="l_options"></asp:literal>
                        </select>
                    </td>
                </tr>
            </table>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                提交</button></div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button class="close">
                                关闭</button></div>
                    </div>
                </li>
            </ul>
        </div>
        </form>
    </div>
</div>
